package com.xuyiwei.mayi;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

/**
 * Created by xuyiwei on 2019/4/24.
 */
public class OrderService {
    public static void addOrder() {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("consumer.xml");
        applicationContext.start();
        System.out.println("###order服務,开始调用会员服务");
        UserService userService=(UserService) applicationContext.getBean("userService");
        String userName = userService.getUser(1l);
        System.out.println("###order服務,结束调用会员服务,userName:" + userName);
    }
    public static void main(String[] args) throws IOException {
        addOrder();
        System.in.read();
    }



}
